﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DjBlog.Admin
{
    public partial class CateManager : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

            }
            else
            {
                string code = DjCommon.Utils.GetFormString("code");
                if (code != "Djqq1987!!!")
                {
                    return;
                }
                DjModel.TermInfo term = new DjModel.TermInfo();
                term.TermName = DjCommon.Utils.GetFormString("title");
                term.TermGroup = DjCommon.Utils.GetFormInt("selterm");
                term.TermPos = DjCommon.Utils.GetFormInt("pos");
                term.PostNum = DjCommon.Utils.GetFormInt("postnum");

                if (term.TermName.Trim() == "")
                {
                    DjBll.Term.ReloadDic();
                    Response.Write("字典更新成功!");
                }
                else
                {
                    int ret = DjBll.Term.AddTerm(term);
                    if (ret == 1)
                    {
                        DjBll.Term.ReloadDic();
                        Response.Write("成功!");
                    }
                    else
                    {
                        Response.Write("失败!");
                    }
                }
            }
        }
    }
}
